package com.ntschy.sys.service.impl;

import cn.hutool.core.util.IdUtil;
import com.ntschy.common.core.entity.dataobject.SysCompany;
import com.ntschy.sys.mapper.SysCompanyMapper;
import com.ntschy.sys.service.ISysCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ezreal_geng
 */
@Service
public class SysCompanyServiceImpl implements ISysCompanyService {

    @Autowired
    private SysCompanyMapper companyMapper;

    // * ================================================基础增删改查BEGIN============================================= *

    @Override
    public List<SysCompany> pageCompany(SysCompany company) {
        return companyMapper.pageCompany(company);
    }

    @Override
    public int addCompany(SysCompany company) {
        company.setId(IdUtil.fastUUID());
        return companyMapper.insert(company);
    }

    @Override
    public int updateCompany(SysCompany company) {
        return companyMapper.updateById(company);
    }

    @Override
    public int deleteCompany(String id) {
        return companyMapper.deleteById(id);
    }

    // * =================================================基础增删改查END============================================== *
}
